package com.pavco.caribbeanvisit.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.RootLayoutPanel;

public class CaribbeanVisit implements EntryPoint {
  final public static MyResources resources = GWT.create(MyResources.class);
  
  @Override
  public void onModuleLoad() {
    /*String userAgent = Window.Navigator.getUserAgent();

    // Redirect to mobile version
    if (userAgent.toLowerCase().contains("iphone")) {
      Window.Location.replace("/i/");
    }*/
    
    Window.setMargin("0px");
    MyResources.INSTANCE.caribbeanVisitCss().ensureInjected();
    
  	HandlerManager eventBus = new HandlerManager(null);
  	RpcServiceAsync rpcService = GWT.create(RpcService.class);
  	AppController appViewer = new AppController(rpcService, eventBus);
  	appViewer.go(RootLayoutPanel.get());
  	
    /*MainView p = new MainView(eventBus);
    RootLayoutPanel panel = RootLayoutPanel.get();
    panel.add(p);*/
  }
}